#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;

int FindMid(int a[], int n)
{
	sort(a, a+n);
	return n%2 == 0? (a[n/2]+a[n/2-1])/2: a[n/2];
}
int main()
{
	int n;
	int x[10001], y[10001];
	int cX[10001], cY[10001];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
		cX[i] = x[i];
		cY[i] = y[i];
	}
	int mid_x = FindMid(cX, n), mid_y = FindMid(cY, n);
	int sum = 0;
	
	for (int i = 0; i < n; i++)
	{
		sum += abs(x[i]-mid_x) + abs(y[i]-mid_y);
	}
	cout << sum << endl;
}
